package com.xuzimian.globaldemo.spring.springwebflux.handler;

import com.xuzimian.globaldemo.spring.springwebflux.model.User;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;
/**
 * @program: spring-webflux
 * @description:
 * @author: xzm
 * @create: 2019-04-28 17:23
 **/
@Component
public class UserHandler {

    public Mono<ServerResponse> getUser(ServerRequest request) {
        return  ServerResponse.ok().body(Mono.just(new User()), User.class);
    }

    public Mono<ServerResponse> getUserCustomers(ServerRequest request)  {
       System.out.println(request.pathVariable("customers"));
        return  ServerResponse.ok().body(Mono.just(new User()), User.class);
    }

}
